<?php
class Core_Data_Citydata implements Core_Data_Mainable {
    
    public function main(array $variables = null) {
        $url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$variables['city']."&sensor=false";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        $response = curl_exec($ch);
        curl_close($ch);
        $response_a = json_decode($response, true);
        return $response_a;
    }

}
